const staff = require("../dal/staff");

const model = {
    async getList(obj = {}) {
        const res = await staff.getList(obj);
        if (obj.paging) {
            const { data } = await staff.getCount();
            res.total = data;
        }
        return res;
    },

    async addItem(obj) {
        const res = await staff.addItem(obj);
        return res;
    },

    async delItem(obj) {
        const res = await staff.delItem(obj);
        return res;
    },

    async updateItem(where, params) {
        const res = await staff.updateItem(where, params);
        return res
    }
}

module.exports = model;